package org.app;

import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;

import org.msg.ProducerLocal;

@ManagedBean(name = "messageBean")
public class MessageBean {

	@EJB
	private ProducerLocal producer;
	
	public MessageBean() {
	}

	public void sendMessage() {
		producer.sendMessage();
		FacesContext.getCurrentInstance().addMessage("form1:btn",
				new FacesMessage("Message has been sccesfuly sent"));
	}
}
